# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-h3
_pkgname=${pkgname#python-}
pkgver=4.1.2
pkgrel=3
pkgdesc='Python bindings for H3, a hierarchical hexagonal geospatial indexing system.'
arch=('x86_64' 'aarch64')
url='https://github.com/uber/h3-py'
license=('MIT')
depends=('python')
makedepends=('git' 'python-build' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('4e1b5d732f055ca7a106a916f22b354245f9e0c8318ab283fc7fb267f41507066b958f87a125b2f8c51edfd95c8d5b30bcbb182de20ae0ad2ef2bb7f5311c8fd')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

